<template>
    <div style="height:50px;line-height:50px;position:relative;font-size:14px;padding:0 4vw;background:#ffffff"><span>申请售后编号：&nbsp;&nbsp;</span><span>{{code}}</span>
        <span style="position:absolute;display:none;background:rgba(0,0,0,.4);left: 0; right: 0; margin-left: auto; margin-right: auto; color:#fff" class="copyTip">已复制</span>
        <mu-button color="#ffffff" v-clipboard:copy="code" v-clipboard:success="onCopy" textColor="#333333" :ripple=false :flat=true style="border:1px solid #333333;border-radius: 5px;height:20px;width:50px;padding:0px;float:right;margin-top:15px">复制</mu-button>
    </div>
</template>
<script>
    export default {
        name:'serviceCode',
        data () {
            return {
                code:'111111111111111'
            }
        },
        props:['chioce'],
        methods:{
            onCopy: function (e) {
                // var copyTip=document.getElementsByClassName('copyTip')[0];
                // console.log(copyTip,document.getElementsByClassName('copyTip'));
                // copyTip.style.display='block';
                // setTimeout(function(){
                //     copyTip.style.display='none';
                // },1000)
            },
            onError: function (e) {
                alert('复制失败')
            }
        },
        mounted(){
            // this.chioce=this.chioce;
        }
    }
</script>
<style lang="scss">
    .mu-flat-button .mu-button-wrapper{
        padding:0px
    }
    .mu-flat-button{
        min-width: auto；
    }
</style>

